import java.util.List;

private List<Shape> shapes = new ArrayList<Shape>();
private Mouse mouse;

void setup()
{
  size(640, 480);
  
  this.mouse = new Mouse();
  Polonaise polonaise = new Polonaise(mouse);
  
  for (int i = 0; i < 10; i++)
  {
    Shape shape = new Shape(new Vector2(320, 240), polonaise);
    polonaise.attach(shape);
    this.shapes.add(shape);
  }
}

void draw()
{
  clear();
  this.mouse.raiseEvent();
  for (Shape shape : shapes)
  {
    shape.update();
    shape.drawShape();
  }
}
